.class public Lcom/estrongs/android/taskmanager/b/h;
.super Ljava/lang/Object;


# static fields
.field private static b:Ljava/lang/String;

.field private static e:I

.field private static f:I

.field private static g:I

.field private static h:I

.field private static i:I


# instance fields
.field private a:Ljava/util/ArrayList;

.field private c:Landroid/content/Context;

.field private d:Z


# direct methods
.method static constructor <clinit>()V
    .locals 2

    const/4 v1, -0x1

    const/4 v0, 0x0

    sput-object v0, Lcom/estrongs/android/taskmanager/b/h;->b:Ljava/lang/String;

    sput v1, Lcom/estrongs/android/taskmanager/b/h;->e:I

    sput v1, Lcom/estrongs/android/taskmanager/b/h;->f:I

    sput v1, Lcom/estrongs/android/taskmanager/b/h;->g:I

    sput v1, Lcom/estrongs/android/taskmanager/b/h;->h:I

    sput v1, Lcom/estrongs/android/taskmanager/b/h;->i:I

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;)V
    .locals 2

    const/4 v1, 0x0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/estrongs/android/taskmanager/b/h;->a:Ljava/util/ArrayList;

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/estrongs/android/taskmanager/b/h;->c:Landroid/content/Context;

    iput-boolean v1, p0, Lcom/estrongs/android/taskmanager/b/h;->d:Z

    iput-object p1, p0, Lcom/estrongs/android/taskmanager/b/h;->c:Landroid/content/Context;

    iget-boolean v0, p0, Lcom/estrongs/android/taskmanager/b/h;->d:Z

    if-eqz v0, :cond_0

    :goto_0
    return-void

    :cond_0
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/estrongs/android/taskmanager/b/h;->d:Z

    invoke-direct {p0}, Lcom/estrongs/android/taskmanager/b/h;->g()V

    iput-boolean v1, p0, Lcom/estrongs/android/taskmanager/b/h;->d:Z

    goto :goto_0
.end method

.method static synthetic a()I
    .locals 1

    sget v0, Lcom/estrongs/android/taskmanager/b/h;->e:I

    return v0
.end method

.method static synthetic b()I
    .locals 1

    sget v0, Lcom/estrongs/android/taskmanager/b/h;->h:I

    return v0
.end method

.method static synthetic b(Ljava/lang/String;)V
    .locals 0

    sput-object p0, Lcom/estrongs/android/taskmanager/b/h;->b:Ljava/lang/String;

    return-void
.end method

.method static synthetic c()I
    .locals 1

    sget v0, Lcom/estrongs/android/taskmanager/b/h;->i:I

    return v0
.end method

.method static synthetic d()I
    .locals 1

    sget v0, Lcom/estrongs/android/taskmanager/b/h;->g:I

    return v0
.end method

.method static synthetic e()I
    .locals 1

    sget v0, Lcom/estrongs/android/taskmanager/b/h;->f:I

    return v0
.end method

.method static synthetic f()Ljava/lang/String;
    .locals 1

    sget-object v0, Lcom/estrongs/android/taskmanager/b/h;->b:Ljava/lang/String;

    return-object v0
.end method

.method private g()V
    .locals 11

    const/4 v10, 0x1

    const/4 v1, 0x0

    const/4 v9, -0x1

    const-string v0, "ps"

    invoke-static {v0}, Lcom/estrongs/android/taskmanager/tools/g;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    const-string v2, "\n"

    invoke-virtual {v0, v2}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v4

    iget-object v0, p0, Lcom/estrongs/android/taskmanager/b/h;->a:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V

    array-length v5, v4

    move v3, v1

    move v2, v1

    :goto_0
    if-lt v3, v5, :cond_0

    return-void

    :cond_0
    aget-object v6, v4, v3

    if-nez v2, :cond_9

    invoke-virtual {v6}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v0

    const-string v6, "[\\s]+"

    invoke-virtual {v0, v6}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v6

    move v0, v1

    :goto_1
    array-length v7, v6

    if-lt v0, v7, :cond_3

    :cond_1
    add-int/lit8 v0, v2, 0x1

    :cond_2
    :goto_2
    add-int/lit8 v2, v3, 0x1

    move v3, v2

    move v2, v0

    goto :goto_0

    :cond_3
    aget-object v7, v6, v0

    const-string v8, "rss"

    invoke-virtual {v7, v8}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v7

    if-eqz v7, :cond_6

    sput v0, Lcom/estrongs/android/taskmanager/b/h;->f:I

    :cond_4
    :goto_3
    sget v7, Lcom/estrongs/android/taskmanager/b/h;->f:I

    if-eq v7, v9, :cond_5

    sget v7, Lcom/estrongs/android/taskmanager/b/h;->g:I

    if-eq v7, v9, :cond_5

    sget v7, Lcom/estrongs/android/taskmanager/b/h;->h:I

    if-eq v7, v9, :cond_5

    sget v7, Lcom/estrongs/android/taskmanager/b/h;->e:I

    if-eq v7, v9, :cond_5

    sget v7, Lcom/estrongs/android/taskmanager/b/h;->i:I

    if-ne v7, v9, :cond_1

    :cond_5
    add-int/lit8 v0, v0, 0x1

    goto :goto_1

    :cond_6
    aget-object v7, v6, v0

    const-string v8, "pid"

    invoke-virtual {v7, v8}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v7

    if-eqz v7, :cond_7

    sput v0, Lcom/estrongs/android/taskmanager/b/h;->h:I

    goto :goto_3

    :cond_7
    aget-object v7, v6, v0

    const-string v8, "user"

    invoke-virtual {v7, v8}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v7

    if-eqz v7, :cond_8

    sput v0, Lcom/estrongs/android/taskmanager/b/h;->e:I

    goto :goto_3

    :cond_8
    aget-object v7, v6, v0

    const-string v8, "ppid"

    invoke-virtual {v7, v8}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v7

    if-eqz v7, :cond_4

    sput v0, Lcom/estrongs/android/taskmanager/b/h;->i:I

    goto :goto_3

    :cond_9
    if-ne v2, v10, :cond_a

    invoke-virtual {v6}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v0

    const-string v7, "[\\s]+"

    invoke-virtual {v0, v7}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v0

    array-length v0, v0

    add-int/lit8 v0, v0, -0x1

    sput v0, Lcom/estrongs/android/taskmanager/b/h;->g:I

    add-int/lit8 v0, v2, 0x1

    :goto_4
    new-instance v2, Lcom/estrongs/android/taskmanager/b/i;

    iget-object v7, p0, Lcom/estrongs/android/taskmanager/b/h;->c:Landroid/content/Context;

    invoke-direct {v2, v7, v6, v10}, Lcom/estrongs/android/taskmanager/b/i;-><init>(Landroid/content/Context;Ljava/lang/String;Z)V

    iget-boolean v6, v2, Lcom/estrongs/android/taskmanager/b/i;->a:Z

    if-eqz v6, :cond_2

    iget-object v6, p0, Lcom/estrongs/android/taskmanager/b/h;->a:Ljava/util/ArrayList;

    invoke-virtual {v6, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    goto :goto_2

    :cond_a
    move v0, v2

    goto :goto_4
.end method


# virtual methods
.method public a(Ljava/lang/String;)Lcom/estrongs/android/taskmanager/b/i;
    .locals 3

    iget-object v0, p0, Lcom/estrongs/android/taskmanager/b/h;->a:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :cond_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-nez v0, :cond_1

    const/4 v0, 0x0

    :goto_0
    return-object v0

    :cond_1
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/estrongs/android/taskmanager/b/i;

    iget-object v2, v0, Lcom/estrongs/android/taskmanager/b/i;->d:Ljava/lang/String;

    invoke-virtual {p1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_0

    goto :goto_0
.end method
